<template>
	<view class="uni-common-mt">
		<view class="logo-box">
			<image src="" mode="center" class="login-logo"></image>
		</view>
		<form class="loginForm" @submit="login">
			<view class="uni-form-item uni-column">
				<input class="my_input" id="my_input" name="input" v-model="userName" placeholder="请输入账户名" />
			</view>
			<view class="uni-form-item uni-column">
				<input class="my_input" id="my_input" name="input" v-model="password" placeholder="请输入密码" />
			</view>
			<view class="forget-register">
				<text class="forget">忘记密码</text>
				<text>|</text>
				<text class="register">新用户注册</text>
			</view>
			<view class="uni-btn-v">
				<button form-type="submit" type="primary">登录</button>
				<text @click="testAndroid">测试原生android插件(勿删)</text>
			</view>
		</form>
	</view>
</template>

<script>
	export default{
	data(){
		return {
			userName:'18077799766',
			password:'1qaz2wsx34'
		}
	},
	onLoad() {
		
	},
	methods:{
		async login(){
			const res= await this.$myRequest({
				method: "post",
				url: '/api-portal/login',
				data:{
					userName:this.userName,
					password:this.password,
				},
			})
			if(res.success == true){
				uni.switchTab({
					url: '/pages/user/index'
				});
			}else{
				uni.showToast({
					title:'登录失败',
					mask:true,
					duration:2000
				})
			}
		}
	}
	
	
	}
	
</script>

<style>
	
	.logo-box {
		width: 100%;
		height: 328rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	.login-logo {
		width: 200rpx;
		height: 200rpx;
		background-color: #109EF8;
		border-radius: 50%;
	}
	
	/* @import url("/static/style/test.css"); */
	.run {
		width: 750rpx; //750rpx,350rpx
	}
	
	form.loginForm>view {
		margin: 50rpx;
	}
	
	.my_input {
		height: 76rpx;
		margin: 10px 5px;
		margin: 0 36rpx 10rpx 36rpx;
		position: relative;
	}
	
	#my_input::after {
		content: "";
		width: 100%;
		height: 2px;
		background: #DBDBDB;
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		margin: 0 auto;
	}
	
	.forget-register {
		color: #B0B0B0;
		margin: 62rpx 0 84rpx 0;
		padding: 0 36rpx 0 0;
		display: flex;
		justify-content: flex-end;
	}
	
	.forget-register text:nth-child(2) {
		margin: 0 20rpx 0 20rpx;
	}
</style>
